package com.yoyo.itravel.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author liuchaojie
 * @version 1.0
 * @Description List跟Map的互相转换
 * @date 2020/6/19 15:06
 */
public class MapExchangeListUtils {
    /**
     * 将map中所有的value存入list集合中
     * @param map
     * @param list
     * @return
     */
    public static List MapValueToList(Map map, List list){
        Set<Object> keys = map.keySet();
        List<Object> values = new ArrayList<>();
        for(Object key: keys){
            values.add(map.get(key));
        }
        return values;
    }
}
